package com.songyang.mybatis.reflection.invoker;

import java.lang.reflect.Field;

/**
 * @ClassName GetFieldInvoker
 * @Description
 * @date 2023/3/29 16:26
 * @Author yanceysong
 * @Version 1.0
 */
public class GetFieldInvoker implements Invoker{
    private final Field field;
    public GetFieldInvoker(Field field){
        this.field=field;
    }
    @Override
    public Object invoke(Object target, Object[] args) throws Exception {
        return field.get(target);
    }

    @Override
    public Class<?> getType() {
        return field.getType();
    }
}
